@import 'styles.css';

:host {
  display: block;
}

.header {
  padding: 25px 0;
  text-align: center;
  background: #222;
  img {
    width: 100px;
    height: 13px;
  }
}

.wrapper {
  margin: 100px 0 150px;
}

:host {
  display: block;
}

.header {
  padding: 25px 0;
  text-align: center;
  background: #222;
  img {
    width: 100px;
    height: 13px;
  }
}

.wrapper {
  margin: 100px 0 150px;
}

.tesla-battery {
  width: 1050px;
  margin: 0 auto;
  h1 {
    font-family: 'RobotoNormal';
    font-weight: 100;
    font-size: 38px;
    text-align: center;
    letter-spacing: 3px;
  }
  &__notice {
    margin: 20px 0;
    font-size: 15px;
    color: #666;
    line-height: 20px;
  }
}

.tesla-climate {
  float: left;
  width: 420px;
  padding: 0 40px;
  margin: 0 40px 0 0;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
}

.tesla-controls {
  display: block;
  width: 100%;
}

@mixin prefix($property, $value) {
  $prefixes: (webkit moz ms o);
  @each $prefix in $prefixes {
    #{'-' + $prefix + '-' + $property}: $value;
  }
  // Output standard non-prefixed declaration
  #{$property}: $value;
}

.tesla-car {
  width: 100%;
  min-height: 350px;
  background: #fff url(assets/tesla.jpg) no-repeat top center;
  background-size: contain;
}

.tesla-wheels {
  height: 247px;
  width: 555px;
  position: relative;
  margin: auto;
}

.tesla-wheel {
  height: 80px;
  width: 80px;
  bottom: 0;
  position: absolute;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: cover;
  &--front {
    left: 652px;
  }
  &--rear {
    right: -26px;
  }
  &--19 {
    &--45 {
      background-image: url(assets/wheel-19.png);
      @include prefix(animation, infinite-spinning 230ms steps(6) infinite);
    }
    &--50 {
      background-image: url(assets/wheel-19.png);
      @include prefix(animation, infinite-spinning 200ms steps(6) infinite);
    }
    &--55 {
      background-image: url(assets/wheel-19.png);
      @include prefix(animation, infinite-spinning 170ms steps(6) infinite);
    }
    &--60 {
      background-image: url(assets/wheel-19.png);
      @include prefix(animation, infinite-spinning 140ms steps(6) infinite);
    }
    &--65 {
      background-image: url(assets/wheel-19.png);
      @include prefix(animation, infinite-spinning 110ms steps(6) infinite);
    }
    &--70 {
      background-image: url(assets/wheel-19.png);
      @include prefix(animation, infinite-spinning 80ms steps(6) infinite);
    }
  }
  &--21 {
    &--45 {
      background-image: url(assets/wheel-21.png);
      @include prefix(animation, infinite-spinning 480ms steps(12) infinite);
    }
    &--50 {
      background-image: url(assets/wheel-21.png);
      @include prefix(animation, infinite-spinning 400ms steps(12) infinite);
    }
    &--55 {
      background-image: url(assets/wheel-21.png);
      @include prefix(animation, infinite-spinning 320ms steps(12) infinite);
    }
    &--60 {
      background-image: url(assets/wheel-21.png);
      @include prefix(animation, infinite-spinning 240ms steps(12) infinite);
    }
    &--65 {
      background-image: url(assets/wheel-21.png);
      @include prefix(animation, infinite-spinning 160ms steps(12) infinite);
    }
    &--70 {
      background-image: url(assets/wheel-21.png);
      @include prefix(animation, infinite-spinning 80ms steps(12) infinite);
    }
  }
}

@keyframes infinite-spinning {
  from {
    @include prefix(transform, rotate(0deg));
  }
  to {
    @include prefix(transform, rotate(360deg));
  }
}

@-webkit-keyframes infinite-spinning {
  from {
    @include prefix(transform, rotate(0deg));
  }
  to {
    @include prefix(transform, rotate(360deg));
  }
}

.tesla-climate {
  float: left;
  &__item {
    cursor: pointer;
    display: inline-block;
    width: 100px;
    height: 100px;
    border: 6px solid #f7f7f7;
    border-radius: 50%;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);
    color: #666;
    background: #fff;
    &--active {
      color: #fff;
      background: #33a0ff;
      background: -moz-linear-gradient(top, #33a0ff 0%, #388bff 100%);
      background: -webkit-linear-gradient(top, #33a0ff 0%, #388bff 100%);
      background: linear-gradient(to bottom, #33a0ff 0%, #388bff 100%);
      &.tesla-heat {
        background: #d64800;
        background: -moz-linear-gradient(top, #d64800 0%, #d20200 100%);
        background: -webkit-linear-gradient(top, #d64800 0%, #d20200 100%);
        background: linear-gradient(to bottom, #d64800 0%, #d20200 100%);
      }
    }
  }
  &__icon {
    display: block;
    width: 22px;
    height: 22px;
    margin: 8px auto 0;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url(assets/climate/ac-off.svg);
    .tesla-heat & {
      background-image: url(assets/climate/heat-off.svg);
    }
    .tesla-climate__item--active & {
      background-image: url(assets/climate/ac-on.svg);
    }
    .tesla-climate__item--active.tesla-heat & {
      background-image: url(assets/climate/heat-on.svg);
    }
  }
  .heat {
    margin: 14px 0 0;
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
  }
  input[type='checkbox'] {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }
}

.tesla-counter {
  float: left;
  width: 230px;
  &__title {
    letter-spacing: 2px;
    font-size: 16px;
  }
  &__container {
    margin: 10px 0 0;
    padding-right: 40px;
    input[type='number'] {
      border: 0;
      clip: rect(0 0 0 0);
      height: 1px;
      margin: -1px;
      overflow: hidden;
      padding: 0;
      position: absolute;
      width: 1px;
    }
  }
  &__number {
    font-family: 'RobotoNormal';
    font-size: 25px;
    line-height: 25px;
    font-weight: 400;
    position: relative;
    span {
      position: absolute;
      top: 0;
      left: 45px;
      font-size: 15px;
      text-transform: uppercase;
    }
  }
  &__item {
    position: relative;
    width: 100%;
    height: 65px;
    border: 1px solid #ccc;
    display: inline-block;
    padding: 18px 0 0 30px;
    margin: 0 8px 0 0;
    background-color: #f7f7f7;
    background-position: 24.21053% 9px;
    background-repeat: no-repeat;
    background-size: 44px;
    &:focus {
      background-color: #f2f2f2;
      outline: none;
    }
  }
  &__controls {
    position: absolute;
    right: 10px;
    top: 7px;
    button {
      outline: 0;
      width: 30px;
      color: #008dff;
      cursor: pointer;
      display: block;
      padding: 11px 0;
      vertical-align: middle;
      border: 0;
      background-size: 60%;
      background-position: center;
      background-repeat: no-repeat;
      background-color: transparent;
      &[disabled] {
        opacity: 0.4;
        cursor: not-allowed;
      }
      &:first-child {
        border-bottom: 1px solid #fff;
        background-image: url(assets/counter/up.svg);
      }
      &:last-child {
        border-top: 1px solid #ccc;
        background-image: url(assets/counter/down.svg);
      }
    }
  }
}

.tesla-stats {
  margin: -70px 0 30px;
  ul {
    text-align: center;
    li {
      display: inline-block;
      width: 130px;
      position: relative;
      p {
        font-size: 40px;
        font-weight: normal;
        font-family: 'RobotoNormal';
        display: block;
        padding: 0 18px 0 0;
        position: relative;
        color: #008dff;
        text-align: right;
        &:after {
          font-size: 14px;
          font-weight: normal;
          font-family: 'RobotoNormal';
          content: 'KM';
          position: absolute;
          top: 8px;
          right: 10;
        }
      }
    }
  }
  &-icon {
    height: 20px;
    background-size: auto 13px;
    background-position: top right;
    background-repeat: no-repeat;
    &--60 {
      background-image: url(assets/models/60.svg);
    }
    &--60d {
      background-image: url(assets/models/60d.svg);
    }
    &--75 {
      background-image: url(assets/models/75.svg);
    }
    &--75d {
      background-image: url(assets/models/75d.svg);
    }
    &--90d {
      background-image: url(assets/models/90d.svg);
    }
    &--p100d {
      background-image: url(assets/models/p100d.svg);
    }
  }
}

.tesla-wheels {
  float: left;
  width: 355px;
  &__title {
    letter-spacing: 2px;
    font-size: 16px;
  }
  &__container {
    margin: 10px 0 0;
  }
  &__item {
    cursor: pointer;
    width: 47%;
    height: 65px;
    border: 1px solid #ccc;
    display: inline-block;
    padding: 20px 0 0 90px;
    margin: 0 8px 0 0;
    background-color: #f7f7f7;
    background-position: 24.21053% 9px;
    background-repeat: no-repeat;
    background-size: 44px;
    &--19 {
      background-image: url(assets/wheels/19.svg);
    }
    &--21 {
      background-image: url(assets/wheels/21.svg);
    }
    &--focused {
      background-color: #f2f2f2;
    }
    &--active {
      border-color: #39f;
      box-shadow: inset 0px 0px 0px 1px #39f;
    }
    p {
      font-family: 'RobotoNormal';
      font-size: 16px;
      font-weight: 400;
      color: #333;
    }
    input[type='radio'] {
      border: 0;
      clip: rect(0 0 0 0);
      height: 1px;
      margin: -1px;
      overflow: hidden;
      padding: 0;
      position: absolute;
      width: 1px;
    }
  }
}
